<template>
  <el-date-picker
    v-model="modelValue"
    type="date"
    style="width: 100%"
    :format="props.format"
    :value-format="props.valueFormat"
    @change="handleChange"
  />
</template>

<script setup>
const modelValue = defineModel();
const emit = defineEmits(['change']);
const props = defineProps({
  format: {
    type: String,
    default: 'YYYY-MM-DD'
  },
  valueFormat: {
    type: String,
    default: 'YYYY-MM-DD'
  }
});

const handleChange = (val) => {
  emit('change', val);
};
</script>